<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>美兰数据文化馆与图书馆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
</head>
<style>
    .caller-img{
        border-radius: 100%;
        height: 40px;
        width: 40px;
        float: left;
        border: medium none;
    }
    .divhtml{
        line-height: 20px;
        padding: 9px 0px;
        text-align:left;
        position:relative;
        display:block;
        float:left;
        font-weight: 400;
    }
</style>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <ul class="layui-timeline" id="lifechain">
                        <li class="layui-timeline-item" style="border-bottom: 1px solid #e0e0e0">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">开始</h3>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>

<script>
    function child(tid){
        layui.use(['form','table','carousel'], function(){
            var $ = layui.$
                , form = layui.form
                , table = layui.table
                , carousel = layui.carousel;

            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/process/getApplyProcess",
                dataType: "json",
                async: false,
                data:"tid="+tid,
                success: function (data) {
                    for(var i=0;i<data.data.length;i++){
                        var str =data.data[i].year;
                        var reg =/(\d{4})\-(\d{2})\-(\d{2})/;
                        var date = str.replace(reg,"$1年$2月$3日");

                        var stryy =data.data[i].time;


                        var ss="";
                        if(data.data[i].operator==""){
                            ss="待审批";
                        }else {
                            ss=date+'<span style="font-size: 14px;">'+stryy;
                        }

//                    var reg =/(\d{4})\-(\d{2})\-(\d{2})/;
//                    var date2 = stryy.replace(reg,"$1时$2分$3秒");
                        var id = "imageHtml" + i;
                        var ids = "image" + i;
                        var lifeli='<li class="layui-timeline-item" style="border-bottom: 1px solid #e0e0e0;">' +
                            '<i class="layui-icon layui-timeline-axis"></i>' +
                            '<div class="layui-timeline-content layui-text">' +
                            '<h3 class="layui-timeline-title">'+ss+'</span></h3>'+
                            // '<div style="float: left">' +
                            // '<div class="layui-carousel" id="' + id + '"  lay-filter="' + id + '" style="width: 40px; height: 40px;"><div carousel-item=""  id="' + ids + '" >' +
                            // '</div></div>' +
                            // '</div>' +
                            '<div  style="margin-left: 0px">'+
                            '<p>审批人：'+data.data[i].operatorname+'<em></em>审批结果：'+data.data[i].result+'</p>'+
                            '<p>审批意见：'+data.data[i].opinion+'</p>'+
                            // '<p style="color: #1e9fff"><a href="javascript:;"  style="text-decoration: none;" onclick="singleonclick(\''+data.data[i].id+'\',\''+data.data[i].number+'\')">'+data.data[i].number+'</a></p>'+
                            '</div>' +
                            '</div>' +
                            '</li>'
                        $("#lifechain").append(lifeli)
                    }
                    if(data.msg=="0"){

                    }else {
                        var lifeli='<li class="layui-timeline-item">\n' +
                            '<i class="layui-icon layui-timeline-axis"></i>\n' +
                            '<div class="layui-timeline-content layui-text">\n' +
                            '<h3 class="layui-timeline-title">结束</h3>\n' +
                            '</div>\n' +
                            '</li>'
                        $("#lifechain").append(lifeli)
                    }





                }
            })
        });
    }
</script>
</body>
</html>